﻿@page
@{ Layout = "_LayoutHome"; }
@section Styles{
  <style>
    .el-upload, .el-upload-dragger {
        width: 150px;
    }
  </style>
}

<div style="height: 10px;"></div>
<el-form ref="form" :model="form" size="small" status-icon label-width="140px">
  <el-form-item label="用户名">
    <el-input v-model="form.userName" disabled></el-input>
  </el-form-item>
  <el-form-item label="头像">
    <el-upload
      :action="uploadUrl"
      :file-list="uploadFileList"
      :headers="{Authorization: 'Bearer ' + $token}"
      list-type="picture-card"
      :before-upload="uploadBefore"
      :on-progress="uploadProgress"
      :on-success="uploadSuccess"
      :on-error="uploadError"
      :on-remove="uploadRemove"
      :multiple="false">
      <i class="el-icon-plus"></i>
    </el-upload>
  </el-form-item>
  <el-form-item label="手机号码" prop="mobile" :rules="mobileValidateRules">
    <el-input v-model="form.mobile" placeholder="请输入手机号码"></el-input>
    <small class="tips">手机号码可用于登录、找回密码等功能</small>
  </el-form-item>
  <el-form-item v-if="isMobileCode" label="短信验证码" prop="code" :rules="[{ required: true, message: '请输入短信验证码' }]">
    <el-input v-model="form.code" autocomplete="off" placeholder="请输入短信验证码">
      <template slot="append">
        <el-link :underline="false" v-on:click.prevent="btnSendSmsClick">
          {{ countdown > 0 ? countdown + '秒': '获取验证码' }}
        </el-link>
      </template>
    </el-input>
  </el-form-item>
  <el-form-item label="电子邮箱" prop="email" :rules="[
    { type: 'email', message: '请输入有效的电子邮箱' }
  ]">
    <el-input v-model="form.email" placeholder="请输入电子邮箱"></el-input>
    <small class="tips">电子邮箱可用于登录、找回密码等功能</small>
  </el-form-item>

  @await Html.PartialAsync("_PartialForm")
  
</el-form>

<el-divider></el-divider>
<div style="height: 10px"></div>

<el-row>
  <el-col :span="24" align="center">
    <el-button type="primary" v-on:click="btnSubmitClick" size="small">确 定</el-button>
  </el-col>
</el-row>

@section Scripts{
<script src="/sitefiles/assets/js/home/profile.js" type="text/javascript"></script> }